﻿using System;
using System.Globalization;
using System.Windows.Data;
using FFmpegVideoClip.Lib.AdvancedFragmentProcessor;

namespace FFmpegVideoClip.Lib.UtilityControlsTools
{
    //如果该参数是标准输入参数，则切到下拉列表控件模板
    [ValueConversion(typeof(string), typeof(bool))]
    public class SignNameTobool : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
                return false;

            string sName = value.ToString()!.Trim();

            if (sName.StartsWith(ParametersSign.InputSignNamePattern, StringComparison.OrdinalIgnoreCase))
                return true;
            return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
